package com.woniu.project.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniu.project.core.domain.ProductEntityAssess;
import com.woniu.project.dto.assessdto.AssessDto;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author WHF
 * @since 2020-10-13
 */
public interface ProductEntityAssessMapper extends BaseMapper<ProductEntityAssess> {

    @Select("select p.product_entity_assess_id,p.product_official_price,\n" +
            "p.product_entity_assess_price,m.management_name,\n" +
            "p.product_entity_assess_time,p.product_entity_assess_comm\n" +
            "from pawn_product_entity_assess p left join pawn_management m\n" +
            "on p.assess_man_id=m.management_id where p.product_entity_id=#{productEntityId}")
    IPage<AssessDto> selectAssessList(Page<AssessDto> page,@Param("productEntityId") Integer productEntityId);

    @Delete("delete from pawn_product_entity_assess where product_entity_id=#{productEntityId}")
    void deleteAssess(Integer productEntityId);
}
